Improve `_exec` and its test coverage

Testing makes one notice subtleties one would otherwise probably miss.