Fix gcc compiling issues