Updated for newer versions of Foreman.