Added better error handling
Updated the submodule with pull request suggestions