fix build issue and warnings