Fixes for tee command