ncloader: added missing error checking