Code fixes general

Woah, a lot of fiddly work for something so simple . . .