Fix non-gui mode compile bug