Cleanup misc

Made changes to the database adapter section and also added a number of other small cleanup things.