Closes #660