Fixed the string building for polynomial functions