Fix divide by zero when no entries are found