Fixed exception catching code being implemented twice, of which one part is never being called.