Various compilation and installation fixes