Fixed NPE in Database.checkConnected()