Cleanly exits from commands.
Merge pull request #90 from Kyuden/clean_command_exit

Cleanly exits from commands.