Fixed a couple of database mapping issues