marked usage of signed ints for lengths, counts, and other questionable acts in ns.h