Attempt to add more error handling.