Some fixes for run on gentoo amd64