Changed database handling.