Fixed possible NPE after the tail collection is cleared.
Merge pull request #34 from ovidiuiliescu/2.4-preparation

Fixed possible NPE after the tail collection is cleared.