Closes #597.