Fix issues with python 2