A number of quick changes made while I got nZEDb up and running.

Couldn't work out how to do a PR for individual commits so everything's included, warts and all