Fix default database is not set properly the first time
Do not connect if no profile is set, etc...