Added dirty unload warning.
Fixed syntax error in setDirty().