Added some tests to cover case from #9462