Added better error handling
Disabled deprecation warnings because OSX