Completes issue #8

corrected errors in the decisions to set the dirty flag.