more test code and ns_log changes