count() checks for errors and throws them
Merge pull request #32 from panrafal/fix-count

Fix: count() checks for errors and throws them