Fixed premature environment cleanup in heroku task