Fix for Python 2.x. Close #1. Thanks, @brianmay