Closes #538. Closes #722