small improvements to the empty list handling