more fixes for local var access and variable access