Fix possibility of empty list