Bugfixes.

- Fixed #4445.
- Fixed #4458.
- Fixed #4479.
- Small fixes.