Fix for Issue #15

Moves the field_type search to the top of the loop so it can be returned immediately