Changes to work on Python 2 and Linux