Cleanup command stack handling in hooke.plugin.polymer_fit.