fix build related bugs