Processing of invalid trees correctly handled