Fix issues running under sh instead of bash