fix another round of found bugs, improve interface