This closes #1181