fix some bugs, add tests for Access