adding limit_scope and filter support. Should close #1035454 and #539534