Fix NPE due to missing values for function outputs