Closes #791