Fix creating and loading custom types