Fixed bug in pos_2d_to_closest_1d() code.