fixed bug when python variables are referenced inside the shell-only context.