Added some fixes on vars without scope