Corrections, tidy up of names and improved management of local database