Small fixes, do not crash if the database is not avaiable