fixed minlength in point_to_hex function