Tests for #440
Fix #440