Removed temporary matrix from undistort function.