Fix several compiling errors.