Minor cleanup and use byte(b)/short(s)/float(p)

clamp pos[2] when transform 2D only and pos[0]/[1] are signed while pos[2] is unsigned in 2D transform