Fix bug, and add TEST command