fix build error and a warning