Fix & Small cleanup

Also added ItemType:getType()
Another fix.
Merge pull request #113 from dalkon/master

Fix & Small cleanup