Merge NODE_TYPE_CASTS and ELEMENT_TYPE_CASTS