[test] Add more tests for better coverage
[minor] Remove unreachable code