Improve free-variable handling for rnPat and friends (fixes Trac #1972)