Fixed database unit tests