a few fixes for datatype