catch errors caused by invalid syntax. fixes #14
remove trailing comma for defines. related to #12
only remove commas in parameters. fixes #12
update xml