Some bugfixes to run in the pi