Some modifications in flag value computation