fixed field type detection
improved field type detection