Fixes #1543

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
Fixes #1566

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
Cleanup of pipe unwrenching code.

Fixes #1509

Signed-off-by: Mloc-Argent <colmohici@gmail.com>