Material data, improved

Sorry for the huge extra commits, it's the first time I managed to merge an updated repository. (I'm bad at Git)
Looks like I made a few mistakes.