Thanks yann0 at hotmail.com for the report.
Also fixed a py3 incompatibility. Thanks to brutasse for the report.