Fix the `--capture` and `--build` flags behaviours.