Fixes #654

Hey this is my suggested fix for the issue I reported earlier.
Link to the issue: https://github.com/Lokaltog/powerline/issues/654