Fixing a few errors in exceptions

All exceptions were reviewed. Hopefully, bugs related to
mis-implementation of try/catch blocks should have been fixed now.