Fixed issue with exceptions not being caught properly