Manual merge from 1.x of fixes for invokeElement