Add test cases for issue #3738