Fixed up overflows and whatnot.