BUG: removed inconsistencies of count (Issues #3368 and #4228)