Fix the errors with -Wstrict-aliasing and -Wsign-compare.