applied pull request from original library to fix the 0-collections bug