Affine correlate: Fixed indexing crash