Fix warnings & simplify safeint.