Fixed: Do not hang when a global var template points to a non-existing g...

Fix for hang if you give a global variable template and the global variable does not exist.

The iLimit should not be needed but like the comment says "better check instead of hang"