Fix bug in previous checkin (typo and logic)