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

Hope it works this time :). 
Reference: PR #4229