Fix MAGN-3960 and MAGN-4049