Some more error-handling.