Polynomial endomorphisms and kernels of derivations