Fix numerical instability on projecting points