Fix error where result is being saved multiple times, due to float precision.