Created by: ikedas
This may fix #857 (closed), and may fix #858 (closed) . See #857 (closed) for details.