Fixed bug with custom datatypes.