Implemented model validation.