[bugfix] Access x[0] only if x has at least one entry