Fix some rank issue