sed options changed to work around an osx-specific issue