Fixes issue #37
Resolves state and other elements before trying for type.