Fix SystemPrincipal cannot be cast to java.lang.String