Fix compile error and add warning.