Simplify trivial casts (and handle pointers specially).