Fixed setVarId-Bugs #5294 and #5295.