Some script fixes