Fix sed errors on OSX, without breaking ubuntu

h/t @Keithbsmiley. Closes #125