fixed bug with wrong distance calculating for uint4