Merge pull request #142 from Gemorroj/master

many fixes, see diff
selected = "selected" to better fit the xml