Fixed an error with auto exit.