Shell script fixes