Cast number of segments to int to fix automatic number of segments.