Tweaks for Python 2 and Linux compatibility

Based on Python 2.7.5 on Fedora 20