Issue #180 - Added more error handling