fix more instances of WEXITSTATUS() use
fix test case