Fixed UGS iteration bug