Slight error handling improvement.