Closes #647