Unit test for fix #1809 on heuristics