My mistake - `set -eu` doesn't escape the function scope.