Bugfixes, but still not working

Materials are loaded and several different materials can be set up.
However, the order of the materials is not yet taken into account,
resulting in wierd stuff.