Fixed integer overflow bug in polynomial regression done via planning