Minor cleanups in manipulation.js