Bugfixes of exception handling, and output strings changed slightly