Added a number of admin functions, improved a few bits and pieces of code.