Fix source order so envs are set before scripts run