change sed parameters so it works with both BSD and GNU sed

Tested on Ubuntu 13.10, thank you!