Fix for bad data inserted as a result of being called with an incorrect typeId