Use more generic `exec`, and fix branch case