Minor fixes

Fixed a few cases where exception handling overlooked corner cases and removed some unreachable code.