Fix redirection operators

Fixes #2259
Fixes #2355
Fixes #3347