python 3 support. additional checks for parameters