Fix problems found by static checking --with-ns