expansion.cpp: minor changes (logging, ifdefs)