Addressed calling-context problem for global and reference variables
Added to last commit
Small fix