Install fixes

These changes will make it easier to install and package downstream.

Tested on 3.19.0 and working.