Minor warning cleanups, mostly dealing with casts