fix small bugs: zero elements in bins