Set 'type' property first. Fixes #3
Merge pull request #4 from msolli/type-property-first

Set 'type' property first. Fixes #3