Fixed PHP warnings when no rank is set