Bugfixes.

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