Minor fixes.

- Fixes problem in encoder with generation materials that have names with non-alphanumeric characters in them.
- Model::getMaterial(int) now returns NULL instead of asserting if material index is not valid.