minor bug fixes in error handling