Fix null collection and fix concurrent exception