Fixed bugs with initialization of Net.