Fixes #599. Fixes #601.