Minor errors when merging database code