Slight change of error handling.