Added one type for every element type, and fixed some bugs.