Few database bug fixes & more database unit tests added.