correct some bugs in jUnit test