Fix compile errors caused by ifdefs