Fixed some MySQL query building things

Also added a better warning to Database.get() when
database type does not exist and an XML fallback is done