Proper init behavior, dirty/undo interaction fix

+General cleanup