added support for pyhton2 and osx bugfixes