Tests for issue #309