Fixed data generator, changed it for error checking earlier