a few infinite-loop bugs remain