When calculating the UV percent, make sure that the end pixel is correct. There seemed to be a slight offset depending on the size of the terrain.