Some trivial bug-fixes and arrangements.
Signed-off-by: MORITA Shintaro <shin@sysphonic.com>