lists: remove NULL from lists

Make sure not to get an element from an empty list and all will be
fine.