Changes to autodetect the database