There should be an else here that throws an exception if t isn't any of the recognized types, to make debugging easier.