Added a test that specifically recreates the problem case from #2150. NEEDS CHECKING.