Fixes #381. Fixes #382. Fixes #387. Scratch.