Also fixes a typo and an incorrectly assigned variable.
This seems like the least complicated way to get the desired reusable behaviors.