move more test cases after the __END__ and remove some diag() callse