Almost completed coding for testcases in isprmgr.c