Remove minus distance
Fix some bug