Earlier checking instanceof RemoteWebDriver didn't work, but I just checked and it works now with the new upgraded WebDriver. Changed to check instanceof now...