Adding test from #751. Verifies that #859 is fixed.