Closes #641