Minor bug fix in data validation