This closes #1170