fixed some minor bugs

new first flag had not been removed from flag list