NaN values are fixed, tests are added