This closes #1131