Type check in element writers