Improves OS X support

Ditches sed in favor of awk.