Release material class and fix other bugs