More fixes. Figured out issues with lists and lapply() interaction.