Bugfixes.

- Fixed #6476.
- Fixed #6643.
- Fixed #7322.