/!\ NOT UPSTREAM: two-step: Fixes for the hack patch

This wasn't 100% correct.
Merge pull request #3 from endlessm/shell/3769

/!\ NOT UPSTREAM: two-step: Fixes for the hack patch