Bugfixes.

- Fixed #6649.
- Fixed #7324.
- Fixed #7330.
Still haven't fixed this...