Fix bug found in code review