fix issues introduced by pull request #22 because of PEP 3113