Improves OS X support

by replacing sed with awk