Tests for #39 and #40.