Added proper error messages.