Fixed bug with STDOUT/STDERR redirection