diff --git a/usrsctplib/netinet/sctp_constants.h b/usrsctplib/netinet/sctp_constants.h
index e275dd955..57240cd3a 100755
--- a/usrsctplib/netinet/sctp_constants.h
+++ b/usrsctplib/netinet/sctp_constants.h
@@ -778,7 +778,7 @@ extern void getwintimeofday(struct timeval *tv);
 #define SCTP_DEFAULT_SPLIT_POINT_MIN 2904
 
 /* Maximum length of diagnostic information in error causes */
-#define SCTP_DIAG_INFO_LEN 64
+#define SCTP_DIAG_INFO_LEN 128
 
 /* ABORT CODES and other tell-tale location
  * codes are generated by adding the below
diff --git a/usrsctplib/netinet/sctp_pcb.c b/usrsctplib/netinet/sctp_pcb.c
index ec3ff6dcb..ca84395a0 100755
--- a/usrsctplib/netinet/sctp_pcb.c
+++ b/usrsctplib/netinet/sctp_pcb.c
@@ -6845,7 +6845,7 @@ sctp_pcb_init()
 	TAILQ_INIT(&SCTP_BASE_INFO(callqueue));
 #endif
 #if defined(__Userspace__)
-	mbuf_init(NULL);
+	usrsctpmbuf_init(NULL);
 	atomic_init();
 #if defined(THREAD_SUPPORT) && (defined(INET) || defined(INET6))
 	recv_thread_init();
diff --git a/usrsctplib/netinet/sctp_usrreq.c b/usrsctplib/netinet/sctp_usrreq.c
index 7d14a9240..9584ae749 100755
--- a/usrsctplib/netinet/sctp_usrreq.c
+++ b/usrsctplib/netinet/sctp_usrreq.c
@@ -196,16 +196,18 @@ sctp_finish(void)
 	sctp_stop_main_timer();
 #endif
 #if defined(__Userspace__)
+#if defined(THREAD_SUPPORT)
 #if defined(INET) || defined(INET6)
 	recv_thread_destroy();
-#endif
+#endif  // INIT || INET6
+// TODO(jkuszmaul): The corresponding #if in recv_thread_init() actually uses Darwin || DragonFly || FreeBSD--not !Windows.
 #if !defined(__Userspace_os_Windows)
 #if defined(INET) || defined(INET6)
 	if (SCTP_BASE_VAR(userspace_route) != -1) {
 		pthread_join(SCTP_BASE_VAR(recvthreadroute), NULL);
 	}
-#endif
-#endif
+#endif  // INIT || INET6
+#endif // !__Userspace_os_Windows
 #ifdef INET
 	if (SCTP_BASE_VAR(userspace_rawsctp) != -1) {
 #if defined(__Userspace_os_Windows)
@@ -213,7 +215,7 @@ sctp_finish(void)
 		CloseHandle(SCTP_BASE_VAR(recvthreadraw));
 #else
 		pthread_join(SCTP_BASE_VAR(recvthreadraw), NULL);
-#endif
+#endif // __Userspace_os_Windows
 	}
 	if (SCTP_BASE_VAR(userspace_udpsctp) != -1) {
 #if defined(__Userspace_os_Windows)
@@ -221,9 +223,9 @@ sctp_finish(void)
 		CloseHandle(SCTP_BASE_VAR(recvthreadudp));
 #else
 		pthread_join(SCTP_BASE_VAR(recvthreadudp), NULL);
-#endif
+#endif // __Userspace_os_Windows
 	}
-#endif
+#endif // INET
 #ifdef INET6
 	if (SCTP_BASE_VAR(userspace_rawsctp6) != -1) {
 #if defined(__Userspace_os_Windows)
@@ -231,7 +233,7 @@ sctp_finish(void)
 		CloseHandle(SCTP_BASE_VAR(recvthreadraw6));
 #else
 		pthread_join(SCTP_BASE_VAR(recvthreadraw6), NULL);
-#endif
+#endif // __Userspace_os_Windows
 	}
 	if (SCTP_BASE_VAR(userspace_udpsctp6) != -1) {
 #if defined(__Userspace_os_Windows)
@@ -239,17 +241,18 @@ sctp_finish(void)
 		CloseHandle(SCTP_BASE_VAR(recvthreadudp6));
 #else
 		pthread_join(SCTP_BASE_VAR(recvthreadudp6), NULL);
-#endif
+#endif // __Userspace_os_Windows
 	}
-#endif
+#endif // INET6
 	SCTP_BASE_VAR(timer_thread_should_exit) = 1;
 #if defined(__Userspace_os_Windows)
 	WaitForSingleObject(SCTP_BASE_VAR(timer_thread), INFINITE);
 	CloseHandle(SCTP_BASE_VAR(timer_thread));
 #else
 	pthread_join(SCTP_BASE_VAR(timer_thread), NULL);
-#endif
-#endif
+#endif // __Userspace_os_Windows
+#endif // THREAD_SUPPORT
+#endif // __Userspace__
 	sctp_pcb_finish();
 #if defined(__Windows__)
 	sctp_finish_sysctls();
diff --git a/usrsctplib/netinet/sctputil.c b/usrsctplib/netinet/sctputil.c
index 87e7774ba..5ac93d590 100755
--- a/usrsctplib/netinet/sctputil.c
+++ b/usrsctplib/netinet/sctputil.c
@@ -5013,7 +5013,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp,
  */
 
 struct mbuf *
-sctp_generate_cause(uint16_t code, char *info)
+sctp_generate_cause(uint16_t code, const char *info)
 {
 	struct mbuf *m;
 	struct sctp_gen_error_cause *cause;
diff --git a/usrsctplib/netinet/sctputil.h b/usrsctplib/netinet/sctputil.h
index 7746d541a..1babe19f1 100755
--- a/usrsctplib/netinet/sctputil.h
+++ b/usrsctplib/netinet/sctputil.h
@@ -281,7 +281,7 @@ sctp_release_pr_sctp_chunk(struct sctp_tcb *, struct sctp_tmit_chunk *,
 #endif
 );
 
-struct mbuf *sctp_generate_cause(uint16_t, char *);
+struct mbuf *sctp_generate_cause(uint16_t, const char *);
 struct mbuf *sctp_generate_no_user_data_cause(uint32_t);
 
 void sctp_bindx_add_address(struct socket *so, struct sctp_inpcb *inp,
diff --git a/usrsctplib/user_mbuf.c b/usrsctplib/user_mbuf.c
index 9a8274637..232d74ed8 100755
--- a/usrsctplib/user_mbuf.c
+++ b/usrsctplib/user_mbuf.c
@@ -121,7 +121,7 @@ m_get(int how, short type)
 	mbuf_mb_args.type = type;
 #endif
 	/* Mbuf master zone, zone_mbuf, has already been
-	 * created in mbuf_init() */
+	 * created in usrsctpmbuf_init() */
 	mret = SCTP_ZONE_GET(zone_mbuf, struct mbuf);
 #if defined(SCTP_SIMPLE_ALLOCATOR)
 	mb_ctor_mbuf(mret, &mbuf_mb_args, 0);
@@ -328,11 +328,11 @@ m_tag_setup(struct m_tag *t, u_int32_t cookie, int type, int len)
 /************ End functions to substitute umem_cache_alloc and umem_cache_free **************/
 
 /* __Userspace__
- * TODO: mbuf_init must be called in the initialization routines
+ * TODO: usrsctpmbuf_init must be called in the initialization routines
  * of userspace stack.
  */
 void
-mbuf_init(void *dummy)
+usrsctpmbuf_init(void *dummy)
 {
 
 	/*
diff --git a/usrsctplib/user_mbuf.h b/usrsctplib/user_mbuf.h
index 7893ea951..64a0ac31c 100755
--- a/usrsctplib/user_mbuf.h
+++ b/usrsctplib/user_mbuf.h
@@ -58,7 +58,7 @@ void m_clget(struct mbuf *m, int how);
 
 
 /* mbuf initialization function */
-void mbuf_init(void *);
+void usrsctpmbuf_init(void *);
 
 #define	M_MOVE_PKTHDR(to, from)	m_move_pkthdr((to), (from))
 #define	MGET(m, how, type)	((m) = m_get((how), (type)))
