It looks to me like that `confine` statement is happening too late, and that things are blowing up before that. If you try setting your kernel fact to some unknown value and then running Facter (i.e. `FACTER_kernel=foo facter`) with this pull request in place it exposes the issue.