TST: Added tests for issue 3504, and commit 4336