Fix compile error: "Cast type parameters must be Dynamic"