Closes #851