Fixes #42.

This was actually fixed in commit 44d4af for #43, but this adds a
regression test from #42.