Fixed flag placement bug