Improved install/target dir handling