fix assertions for recursively checking types