Fix compile error in some cases