Bugfixes.

- Fixed second half of #3383.
- Fixed #3406.
- Fixed #3410.