Fix bug where mod crashes if connection to DB server is lost.