Added collect failure handling and tests