In unit tests, fix bugs about float comparison