Fixed bugs which stopped it working on other Pis