some fixes, tests and updates, fix completion and add tests for it