Fix NoMethodError when using has_css

When using has_css with a count, I was finding that an error is
raise casued by trying to gsub on nil when the element is not.
present. This fix avoids that by casting to a string first,
ensuring the gsub method is available.