Fix main script