Bug fixes

**DO NOT MERGE**

Pull request reviews will be tracked here.
At the same time the pull request will be supplemented by the description.