Count actual occurences of an element, fixes #23