I've recoded nco_get_var1() to illustrate the changes I suggest
to your patch. The rest of the wrappers could be changed similarly.
Up to you how many of the changes to adopt. Rationale for my
changes is explained in the discussion thread. Let me know if
you have any comments or questions about these revisions.