Improve the exit code behavior

Fix #55.