Cleaned up various compiler warnings generated by Wall, Wextra, Wshadow, Wlogical-op, Wcast-qual, and Wdisabled-optimization