fixes from 'http://www.raspberrypi.org/forums/viewtopic.php?f=43&t=70105&p=657575'