debugged and fixed nif test cases