small tweaks and clean up.

Dirty's the Document when marking open or closed on a frame.