Test and fix for #814.