Fixed first_# and last_# flags