applied patch from ruby source
fixed problem with inserting closing quotes and bars