Somehow the set null function should be checked for each type. In future, get rid of those operations