Fixed bug when network metaterms is null.
Also fixed issue caused by merging where code was lost.