Replace end flag from . to end