Add REPL scoping tests
Merge remote-tracking branch 'epidemian/issue1829'
@epidemian typo