Unexpected problem with sed on OSX.

This commit fixes it, but probably breaks on linux. Need to checkout
on another host to test.