Fixed small issue with error handling.