Fixed water.density to accept NA and NaN values.