Fixed Issue #31

did some enhancements on the exit command