Gentoo fixes

Various Gentoo related minor fixes.