Issue #2259947 by donquixote: Fixed Minor bug fixes in database system.