Fix for occasional LUA error during role detection.