path insert and other bug fixes