Fix build error and warning