Fix variable typos introduced in eb8ad408
Use the new available function