Ensure writing initialized flag synchronously
Add comments