Closes #639