Index: library/bdm/base/datasources.h
===================================================================
--- library/bdm/base/datasources.h (revision 1072)
+++ library/bdm/base/datasources.h (revision 1080)
@@ -248,5 +248,10 @@
     //! numeric values of regressor
     vec rgr;
-
+	
+	//! RV for initial conditions
+	RV init_rv;
+	//! initial conditions
+	vec init_values;
+		
 public:
     void step();
@@ -279,39 +284,37 @@
     */
     void from_setting ( const Setting &set ) {
-        ipdf = UI::build<pdf> ( set, "pdf", UI::compulsory );
-
-        RV Yrv = ipdf->_rv();
-        // get unique rvs form rvc
-        RV rgrv0 = ipdf->_rvc().remove_time();
-        // input is what in not in Yrv
-        Urv = rgrv0.subt ( Yrv );
-        Drv=  concat(Yrv,Urv);
-        // connect input and output to rvc
-        ut2rgr.set_connection ( ipdf->_rvc(), Urv );
-        yt2rgr.set_connection ( ipdf->_rvc(), Yrv );
-
-        //set history - if given
-        shared_ptr<RV> rv_ini = UI::build<RV> ( set, "init_rv", UI::optional );
-        if ( rv_ini ) { // check if
-            vec val;
-            UI::get ( val, set, "init_values", UI::optional );
-            if ( val.length() != rv_ini->_dsize() ) {
-                bdm_error ( "init_rv and init_values fields have incompatible sizes" );
-            } else {
-                ut2rgr.set_history ( *rv_ini, val );
-                yt2rgr.set_history ( *rv_ini, val );
-            }
-        }
-
-        yt = zeros ( ipdf->dimension() );
-        rgr = zeros ( ipdf->dimensionc() );
-        ut = zeros ( Urv._dsize() );
-
-        utsize = ut.length();
-        dtsize = yt.length() + utsize;
+		ipdf = UI::build<pdf> ( set, "pdf", UI::compulsory );
+		UI::get ( init_rv, set, "init_rv", UI::optional);
+		UI::get ( init_values, set, "init_values", UI::optional);
     }
 
     void validate() {
-        DS::validate();
+		RV Yrv = ipdf->_rv();
+		// get unique rvs form rvc
+		RV rgrv0 = ipdf->_rvc().remove_time();
+		// input is what in not in Yrv
+		Urv = rgrv0.subt ( Yrv );
+		Drv=  concat(Yrv,Urv);
+		// connect input and output to rvc
+		ut2rgr.set_connection ( ipdf->_rvc(), Urv );
+		yt2rgr.set_connection ( ipdf->_rvc(), Yrv );
+		
+		if ( init_rv._dsize()>0 ) { // check if
+			if ( init_values.length() != init_rv._dsize() ) {
+				bdm_error ( "init_rv and init_values fields have incompatible sizes" );
+			} else {
+				ut2rgr.set_history ( init_rv, init_values );
+				yt2rgr.set_history ( init_rv, init_values );
+			}
+		}
+		
+		yt = zeros ( ipdf->dimension() );
+		rgr = zeros ( ipdf->dimensionc() );
+		ut = zeros ( Urv._dsize() );
+		
+		utsize = ut.length();
+		dtsize = yt.length() + utsize;
+		
+		DS::validate();
 
         //taken from sample() - shift of history is not done here
Index: library/tests/testsuite/egiw.cfg
===================================================================
--- library/tests/testsuite/egiw.cfg (revision 849)
+++ library/tests/testsuite/egiw.cfg (revision 1080)
@@ -4,5 +4,5 @@
   epdf = {
     class = "egiw";
-    V = ( "matrix", 2, 2, [ 13.1, 11.0, 11.0, 10.0 ] );
+    fV = ( "matrix", 2, 2, [ 13.1, 11.0, 11.0, 10.0 ] );
     nu = 10.0;
     dimx = 1;
@@ -27,5 +27,5 @@
   epdf = {
     class = "egiw";
-    V = ( "matrix", 2, 2, [ 200.0, 80.0, 80.0, 40.0 ] );
+    fV = ( "matrix", 2, 2, [ 200.0, 80.0, 80.0, 40.0 ] );
     nu = 40.0;
     dimx = 1;
Index: library/tests/testsuite/datasource_test.cpp
===================================================================
--- library/tests/testsuite/datasource_test.cpp (revision 1072)
+++ library/tests/testsuite/datasource_test.cpp (revision 1080)
@@ -64,8 +64,9 @@
 	Array<shared_ptr<pdf> > Arr(2);
 	Arr(0) = OM;
-	Arr(1)= IM;
+	Arr(1) = IM;
 	
-	shared_ptr<mprod> mp;
+	shared_ptr<mprod> mp=new mprod;
 	mp->set_elements(Arr);
+	mp->validate();
 	
 	pds.ipdf=mp;
@@ -78,5 +79,5 @@
     }
 
-    vec dt;
+    vec dt(4);
 	pds.getdata ( dt );
     CHECK_CLOSE ( vec ( "94.5, 94.5, 13.5, 9" ), dt, 1e-2 );
