fixes completion bugs; fixes #6