fix incompatible sed calls on mac OS X, as commit 31eb5326