Fix some bug in data analysis