Added dynamic scoping tests