Fixed Type in the XML

 Thx Chris
added to GitHub
some code optimizations