Cleaned up edit doc and dirty tracking

Fixed some merge issues.