Fix tangent cases.
Merge branch 'master' of github.com:wei2912/bce-simulation