This should use `isinstance`, rather than `type(field)`, probably.