Support dynamic max groups + fix getpwclass error