Fix missing array key check