Fix globals in script management command
Add RemoveTrailingSlashMiddleware