Avoid divide by zero where document is empty or small