Updated AutoTest.
Fixed some bugs.