Fixing bash scripts