Fix escaping

This function didn't work in ruby 1.9