Fixing some bugs in the RPI port.