Fixed issue causing waitForSelector() to always timeout.