Actually fix local scope tests.
Python: check for output redirection
Perl: check for output redirection
JavaScript: check for output redirection
PHP: fix/check output redirection