Removed redundant sort parameter
Fixed error introduced in getAllFactors()