Improved update_repo script