Closes #1017