fix small scoping bug in compiler