Fix bug when starting point is not 0.