Fix bugs in getting variable and setting up helpers.