This closes #1162