fix logic bugs; fix default offset; fix checker; update test cases