It might be worth making the tolerance a user-settable parameter which defaults to 1.e-6