Your first error is on this line. What are you trying to do here? Is iiMatType even a valid type?