Added calls to isValid() in relevant DatabaseConnector methods.