Field inhomogeneity compensation