Bug found: I wrote code twice to do the same stuff, with the second version being less accurate.