Fix attempt to traverse boolean when removing cache item