Fixed bad material assignments; also changed material ids

Sustaining uint material ids forces there to be a '0' material which represents a default material.
It was getting ugly mapping that back to a normal index, so just use int for now.