minor tweaks to compile on gcc