Fixes #558. Fixes #559.