Fix bug introduced with code smell fix