fix for string manipulation of nil in ruby 2.0.0