Properly initialize flag variables