1. Remove empty bars at the end of a flow by using Write > Trim Flow.
    2. You can also use the Bars and Barlines popover (Shift+B) by typing trim.