Fixed an compliation error and changed to unsigned

factorization.cpp threw warnings about comparisons with unsigned integers