Some more RPi code cleanup (untested)