I didn't create this fix, it was originally posted to http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97983&p=681259. @koosvriezen tried to create a pull request codewithpassion#3 but made kind of a hash of it, so this is the same fix only a proper pull request.