Modify Test and find some bugs

Details are in Testing,java