Manual merge from 1.x of fixes for invokeElement
Merge pull request #91 from morgante/master

Merge pull request #10 from jakiestfu/master
Merge pull request #11 from jakiestfu/master

Upstream