Fix issues when the Shim is called with an undefined element id