Batch of fixes

- Merge from upstream/master
- Linted
- Bug fixes