Fix source install and merge 4.0.1 into master