Closes #668