Fixed issue with return state for formula computation