Assorted warning fixes and cleanups