Closes #871