Fixed issues with error checking