corrected bug in cleanFormulae (setting a list element to NULL shorten the list)