Fix crash introduced by recent changes