Tricky little bug. Didn't catch it when refactoring