Few changes to python source, as Jython does not support 2.7