Fix support for OSX/BSD's sed