Fix prime algorithm to properly handle numbers less than 2