Fixed a couple of warnings and a syntax error.
catoxml added back to lib for Python < 2.7 compatibility.