Temp fix

@SimonGoring I merged all the new stuff from your PR to this branch. Do a quick review (if you like) and then just merge to master.