Fixed variable name issue which was introduced in previous refactoring.