Revert "Remove use of dynamic_cast from tier1 and recompile."

This reverts commit cebfc1e2ef3251f31d572c5a1adb81affe33a6bf.