bugfix and small improvements for top-level-completions, still needs refactoring
background completion bugfixing, needs still more testing + refactoring