compatibility

minor modifications for backwards compatibility with python 2.7