Clean up for PIE.
This brings it working with Beer without breaking anything we have.