Fixed variable name typo; added corresponding unit test.