Update with latest changes to make this work across distros.