fix fields sometimes being the wrong datatype