Add typeinfo header for bad_cast definition
Assert perms using perm->is*, as can* only works post serialization