todo: fix NPE's, when getTypeFor() returns null
Authored by: spj 2011-05-25
Parent: [r1678]
Child: [r1680]