Fixed scope analysis on undeclared variable
Updated scope analysis to check for unassigned variables used