Fixed not closing struct. Fixed arrays. Type by default.
Merge pull request #1 from simon600/master

Fixed bugs.