Added support for "count" requests. Improvements.