fixing some stuff with record types