py script fixes