Avoid trying to compare with R zero length documents