Fixed a bug in which the callback for waitForElement* commands was called with incorrect context