Fixed subscript error in fung_D