Don't infinite loop in serialize