Fix glitch with moveElement optimization