Fixed so restart etc works. dirtyobjects sucks