Fix some issues when attempting to run under gentoo