This `exec` call is pretty much the same as the one above, except that the argument checking is in a different order. Is there a reason for that? If not, let's fix that and reuse this.