small bug fixes for error reporting