Closes #787