Merge tidying

Tidied up the errors introduced by the manual merge made earlier. All
tests are running now.