Add better error messages and validation.