Fixed and improved infrastructure scripts