Fixing flag issues