Fix: Calling count() results in infinite loop