Lots of bugfixes during robot testing

We also had a problem with github and had to manually replace files, so that might cause some weird problems with the formatting.