Database

Various database improvements