Fix: count() checks for errors and throws them