Massive clean up test cases, and so bugfix hidden bugs.