Fixed up some blatant errors with the DB backend.