dont gsub if nil fix 678

This should fix #678, but I could not reproduce the problem.