Cleanly exits from commands.