Change loc.x, loc.x, loc.z to loc.x, loc.y, loc.z

Typos on converting vector to x, y, z