Posix sh fixes

As was discussed in #459