Fix main ref