FIX: Add extra check for LFns in InputData optimizer. Closes #1472