Test cases for #3818