Added improved support for iTerm, added exception handling and added console output.