Small fixes and warning when not connected to DB.