Fix several bad #pragma unused statements; fix a few latent bugs involving NS* arguments.