Fix template and server hang