Fixed code that pops local function/procedure variables from stack