Fix path issues when running as daemon