Index: src/libcfa/exception.c
===================================================================
--- src/libcfa/exception.c	(revision 38ef0debed75b4f4d54a6ea756c3f6326f5f6290)
+++ src/libcfa/exception.c	(revision e59c088f34a5a9a46dbbbf07e83e5e7eb0c27cdc)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 26 15:13:00 2017
 // Last Modified By : Andrew Beach
-// Last Modified On : Fri Jul 28 12:41:00 2017
-// Update Count     : 3
+// Last Modified On : Mon Jul 31 13:51:00 2017
+// Update Count     : 4
 //
 
@@ -109,5 +109,12 @@
 
 // MEMORY MANAGEMENT (still for integers)
-// May have to move to cfa for constructors and destructors.
+// May have to move to cfa for constructors and destructors (references).
+
+struct __cfaehm__node {
+	struct __cfaehm__node * next;
+};
+
+#define NODE_TO_EXCEPT(node) ((exception *)(1 + (node)))
+#define EXCEPT_TO_NODE(except) ((struct __cfaehm__node *)(except) - 1)
 
 // Creates a copy of the indicated exception and sets current_exception to it.
@@ -115,15 +122,16 @@
 	struct exception_context_t * context = this_exception_context();
 
-	// Try to use the context's store, otherwise use the heap.
-	if ( 0 == context->built_in_storage ) {
-		context->current_exception = &context->built_in_storage;
-	} else {
-		exception * new_copy = malloc( sizeof( exception/*int*/ ) );
-		if ( ! new_copy ) {
-			// Failure: cannot allocate exception. Terminate thread.
-			exit(1); // <- thread or program?
-		}
-		context->current_exception = new_copy;
-	}
+	// Allocate memory for the exception.
+	struct __cfaehm__node * store = malloc(
+		sizeof( except ) + sizeof( struct __cfaehm__node ) );
+
+	if ( ! store ) {
+		// Failure: cannot allocate exception. Terminate thread.
+		abort(); // <- Although I think it might be the process.
+	}
+
+	// Add the node to the list:
+	store->next = EXCEPT_TO_NODE(context->current_exception);
+	context->current_exception = NODE_TO_EXCEPT(store);
 
 	// Copy the exception to storage.
@@ -136,18 +144,24 @@
 
 	// DEBUG
-	printf( "Deleting Exception %d (%s)\n", *except,
-		(&context->built_in_storage == except) ? "builtin" : "dynamic" );
+	printf( "Deleting Exception %d\n", *except);
+
+	// Remove the exception from the list.
+	struct __cfaehm__node * to_free = EXCEPT_TO_NODE(except);
+	struct __cfaehm__node * node;
 
 	if ( context->current_exception == except ) {
-		// TODO: This should restore it to the last exception.
-		context->current_exception = NULL;
-	}
-	if ( &context->built_in_storage == except ) {
-		// You can't throw the exception '0'.
-		context->built_in_storage = 0;
+		node = to_free->next;
+		context->current_exception = (node) ? NODE_TO_EXCEPT(node) : 0;
 	} else {
-		// Only secondary or too large exceptions are thrown.
-		free( except );
-	}
+		node = EXCEPT_TO_NODE(context->current_exception);
+		// It may always be in the first or second position.
+		while( to_free != node->next ) {
+			node = node->next;
+		}
+		node->next = to_free->next;
+	}
+
+	// Free the old exception node.
+	free( to_free );
 }
 
