[BUGFIX] Fix undefined variable access

9 jobs for 553-undefined-variables-in-ter_rest in 4 minutes and 14 seconds (queued for 4 seconds)