Fixes for pipe encoding