Added function to retrieve validation errors.