fix accounts bug, add more testcases