Add some tests for Data.hx
More fixes to error checking