[nits] fix some minor bugs and add some path manipulation functions to sqlite