improved parsing and unit tests for Materials.