Implement incremental prefix completion

also fixed a logic bug in find