Fix emit flush even if the collection is empty
Bump version 5.0.2