Fix quoting of single quotes

and a bunch of other nasty characters. DIRTY BASH!