implement get, fix buffer errors, add more tests