Fix heuristic for Laurent series
Add test for github's issue 2519