Back ported setvariable fix from 3.03 to dev (Issues #120 and #68)