Add helpful error message in rule validation.

John wasn't sure what this function was doing, so I fixed its name. Also there is now an error message logged when trying to validate data that is malformed.