Open stdout and stderr streams if they are not already opened
Fix typos