Fixed environment cleanup