Small code improvement
Fix: finite types incorrectly reported as infinite (refix #39)
Add tests for infinite type detection