Fix scripts with dependency injection