fixed bug when resolving default geometry.

The mapping to get the index of the geometry field was used twice, resulting in a wrong index and a later ClassCastException when getting the value.