Some simplifications. Fixed evaluation of empty list.