SEGFAULT fix - m_dirty flag (align with Java target)