fixes to support /bin/sh on linux