Fix bugs in semantic analysis regarding leveling.
Fix bugs in semantic analysis regarding leveling.

Add check for level when checking for redefinitions. Make sure error
only occurs when there's redefinition in the same level.

RyanWangGit/scc