Improved handling of rational functions.