Fix compile error and warning