Index: Makefile.in
===================================================================
--- Makefile.in	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ Makefile.in	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -37,6 +37,6 @@
 	$(top_srcdir)/configure $(top_srcdir)/driver/Makefile.in \
 	$(top_srcdir)/libcfa/Makefile.in $(top_srcdir)/src/Makefile.in \
-	$(top_srcdir)/src/examples/Makefile.in COPYING INSTALL \
-	install-sh missing
+	$(top_srcdir)/src/examples/Makefile.in INSTALL install-sh \
+	missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
Index: configure
===================================================================
--- configure	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ configure	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -2363,5 +2363,4 @@
 
 
-#AM_INIT_AUTOMAKE([foreign])		# do not follow GNU standard
 am__api_version='1.11'
 
Index: src/ControlStruct/LabelFixer.cc
===================================================================
--- src/ControlStruct/LabelFixer.cc	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ src/ControlStruct/LabelFixer.cc	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue May 19 15:25:59 2015
-// Update Count     : 1
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed May 27 16:16:14 2015
+// Update Count     : 4
 //
 
@@ -40,6 +40,5 @@
 
 	void LabelFixer::visit( FunctionDecl *functionDecl ) {
-		if ( functionDecl->get_statements() != 0 )
-			functionDecl->get_statements()->accept( *this );
+		maybeAccept( functionDecl->get_statements(), *this );
 
 		MLEMutator mlemut( resolveJumps(), generator );
@@ -102,9 +101,10 @@
 			Entry *e = i->second;
 
-			if ( def_us.find ( e->get_definition() ) == def_us.end() )
-				def_us[ e->get_definition() ] = e;
-			else
+			if ( def_us.find ( e->get_definition() ) == def_us.end() ) {
+				def_us[ e->get_definition() ] = e;				
+			} else {
 				if ( e->used() )
 					def_us[ e->get_definition() ]->add_uses( e->get_uses() );
+			}
 		}
 
Index: src/ControlStruct/LabelFixer.h
===================================================================
--- src/ControlStruct/LabelFixer.h	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ src/ControlStruct/LabelFixer.h	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue May 19 15:31:55 2015
-// Update Count     : 3
+// Last Modified By : Rob Schluntz
+// Last Modified On : Tue May 26 12:55:10 2015
+// Update Count     : 4
 //
 
@@ -66,13 +66,12 @@
 
 			Label get_label() const { return label; }
+			void set_label( Label lab ) { label = lab; }
+
 			Statement *get_definition() const { return definition; }
+			void set_definition( Statement *def ) { definition = def; }
+
 			std::list< Statement *> &get_uses() { return usage; }
-
 			void add_use ( Statement *use ) { usage.push_back( use ); }
 			void add_uses ( std::list<Statement *> uses ) { usage.insert( usage.end(), uses.begin(), uses.end() ); }
-			void set_definition( Statement *def ) { definition = def; }
-
-			void set_label( Label lab ) { label = lab; }
-			Label gset_label() const { return label; }
 		  private:
 			Label label;  
Index: src/ControlStruct/MLEMutator.cc
===================================================================
--- src/ControlStruct/MLEMutator.cc	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ src/ControlStruct/MLEMutator.cc	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue May 19 15:32:26 2015
-// Update Count     : 2
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed May 27 16:19:32 2015
+// Update Count     : 44
 //
 
@@ -28,5 +28,5 @@
 	CompoundStmt* MLEMutator::mutate( CompoundStmt *cmpndStmt ) {
 		bool labeledBlock = false;
-		if ( !((cmpndStmt->get_labels()).empty()) ) {
+		if ( !(cmpndStmt->get_labels().empty()) ) {
 			labeledBlock = true;
 			enclosingBlocks.push_back( Entry( cmpndStmt ) );
@@ -42,6 +42,7 @@
 					std::list<Label> ls; ls.push_back( get_breakLabel() );
 					kids.push_back( new NullStmt( ls ) );
-				} else
+				} else {
 					(*next)->get_labels().push_back( get_breakLabel() );
+				}
 
 				set_breakLabel("");
@@ -51,6 +52,7 @@
 		if ( labeledBlock ) {
 			assert( ! enclosingBlocks.empty() );
-			if ( ! enclosingBlocks.back().get_breakExit().empty() )
+			if ( ! enclosingBlocks.back().get_breakExit().empty() ) {
 				set_breakLabel( enclosingBlocks.back().get_breakExit() );
+			}
 			enclosingBlocks.pop_back();
 		} // if
@@ -85,10 +87,17 @@
 
 	Statement *MLEMutator::mutate( BranchStmt *branchStmt ) throw ( SemanticError ) {
+		std::string originalTarget = branchStmt->get_originalTarget();
+
 		if ( branchStmt->get_type() == BranchStmt::Goto )
 			return branchStmt;
 
 		// test if continue target is a loop
-		if ( branchStmt->get_type() == BranchStmt::Continue && enclosingLoops.empty() )
-			throw SemanticError( "'continue' outside a loop" );
+		if ( branchStmt->get_type() == BranchStmt::Continue) {
+			if ( enclosingLoops.empty() ) {
+				throw SemanticError( "'continue' outside a loop" );
+			} else if ( std::find( enclosingLoops.begin(), enclosingLoops.end(), (*targetTable)[branchStmt->get_target()] ) == enclosingLoops.end() ) {
+				throw SemanticError( "'continue' target label must be an enclosing loop: " + originalTarget );
+			}
+		}
 
 		if ( branchStmt->get_type() == BranchStmt::Break && (enclosingLoops.empty() && enclosingSwitches.empty() && enclosingBlocks.empty() ) )
@@ -98,5 +107,5 @@
 
 		if ( targetTable->find( branchStmt->get_target() ) == targetTable->end() )
-			throw SemanticError("The label defined in the exit loop statement does not exist." );  // shouldn't happen (since that's already checked)
+			throw SemanticError("The label defined in the exit loop statement does not exist: " + originalTarget );  // shouldn't happen (since that's already checked)
 
 		std::list< Entry >::iterator check;
@@ -106,5 +115,5 @@
 				// neither in loop nor in block, checking if in switch/choose
 				if ( (check = std::find( enclosingSwitches.begin(), enclosingSwitches.end(), (*targetTable)[branchStmt->get_target()] )) == enclosingSwitches.end() )
-					throw SemanticError("The target specified in the exit loop statement does not correspond to an enclosing loop.");
+					throw SemanticError("The target specified in the exit loop statement does not correspond to an enclosing control structure: " + originalTarget );
 
 		if ( enclosingLoops.back() == (*check) )
@@ -114,21 +123,21 @@
 		switch ( branchStmt->get_type() ) {
 		  case BranchStmt::Break:
-			if ( check->get_breakExit() != "" )
-				newLabel = check->get_breakExit();
-			else {
-				newLabel = generator->newLabel();
-				check->set_breakExit( newLabel );
-			} // if
-			break;
+				if ( check->get_breakExit() != "" ) {
+					newLabel = check->get_breakExit();
+				} else {
+					newLabel = generator->newLabel();
+					check->set_breakExit( newLabel );
+				} // if
+				break;
 		  case BranchStmt::Continue:
-			if ( check->get_contExit() != "" )
-				newLabel = check->get_contExit();
-			else {
-				newLabel = generator->newLabel();
-				check->set_contExit( newLabel );
-			} // if
-			break;
+				if ( check->get_contExit() != "" ) {
+					newLabel = check->get_contExit();
+				} else {
+					newLabel = generator->newLabel();
+					check->set_contExit( newLabel );
+				} // if
+				break;
 		  default:
-			return 0;					// shouldn't be here
+				return 0;					// shouldn't be here
 		} // switch
 
@@ -136,9 +145,14 @@
 	}
 
-
-	Statement *MLEMutator::mutate( SwitchStmt *switchStmt ) {
+	template< typename SwitchClass >
+	Statement *handleSwitchStmt( SwitchClass *switchStmt, MLEMutator &mutator ) {
+		// set up some aliases so that the rest of the code isn't messy
+		typedef MLEMutator::Entry Entry;
+		LabelGenerator *generator = mutator.generator;
+		std::list< Entry > &enclosingSwitches = mutator.enclosingSwitches;
+
 		Label brkLabel = generator->newLabel();
 		enclosingSwitches.push_back( Entry(switchStmt, "", brkLabel) );
-		mutateAll( switchStmt->get_branches(), *this ); {
+		mutateAll( switchStmt->get_branches(), mutator ); {
 			// check if this is necessary (if there is a break to this point, otherwise do not generate
 			std::list<Label> temp; temp.push_back( brkLabel );
@@ -150,15 +164,10 @@
 	}
 
+	Statement *MLEMutator::mutate( SwitchStmt *switchStmt ) {
+		return handleSwitchStmt( switchStmt, *this );
+	}
+
 	Statement *MLEMutator::mutate( ChooseStmt *switchStmt ) {
-		Label brkLabel = generator->newLabel();
-		enclosingSwitches.push_back( Entry(switchStmt,"", brkLabel) );
-		mutateAll( switchStmt->get_branches(), *this ); {
-			// check if this is necessary (if there is a break to this point, otherwise do not generate
-			std::list<Label> temp; temp.push_back( brkLabel );
-			switchStmt->get_branches().push_back( new BranchStmt( temp, Label(""), BranchStmt::Break ) );
-		}
-		assert ( enclosingSwitches.back() == switchStmt );
-		enclosingSwitches.pop_back();
-		return switchStmt;
+		return handleSwitchStmt( switchStmt, *this );		
 	}
 
Index: src/ControlStruct/MLEMutator.h
===================================================================
--- src/ControlStruct/MLEMutator.h	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ src/ControlStruct/MLEMutator.h	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue May 19 15:32:39 2015
-// Update Count     : 3
+// Last Modified By : Rob Schluntz
+// Last Modified On : Tue May 26 15:04:21 2015
+// Update Count     : 7
 //
 
@@ -75,4 +75,7 @@
 		Label breakLabel;
 		LabelGenerator *generator;
+
+		template< typename SwitchClass > 
+		friend Statement *handleSwitchStmt( SwitchClass *switchStmt, MLEMutator &mutator );
 	};
 } // namespace ControlStruct
Index: src/SynTree/Statement.cc
===================================================================
--- src/SynTree/Statement.cc	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ src/SynTree/Statement.cc	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 10:55:19 2015
-// Update Count     : 2
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed May 27 15:41:13 2015
+// Update Count     : 8
 //
 
@@ -46,5 +46,5 @@
 
 BranchStmt::BranchStmt( std::list<Label> labels, Label _target, Type _type ) throw ( SemanticError ) :
-	Statement( labels ), target(_target ), type(_type ) {
+	Statement( labels ), originalTarget(_target ), target(_target ), type(_type ) {
 	//actually this is a syntactic error signaled by the parser
 	if ( type == BranchStmt::Goto && target.size() == 0 )
@@ -200,4 +200,10 @@
 
 void ForStmt::print( std::ostream &os, int indent ) {
+	os << "\r" << string( indent, ' ') << "Labels: {";
+	for (std::list<Label>::iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
+		os << *it << ",";
+	}
+	os << "}" << endl;
+
 	os << "\r" << string( indent, ' ') << "For Statement" << endl ;
 
Index: src/SynTree/Statement.h
===================================================================
--- src/SynTree/Statement.h	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ src/SynTree/Statement.h	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 10:57:40 2015
-// Update Count     : 2
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed May 27 15:40:43 2015
+// Update Count     : 5
 //
 
@@ -227,4 +227,5 @@
 	virtual ~BranchStmt() {}
 
+	Label get_originalTarget() { return originalTarget; }
 	Label get_target() { return target; }
 	void set_target( Label newValue ) { target = newValue; }
@@ -242,4 +243,5 @@
   private:
 	static const char *brType[];
+	Label originalTarget;  // can give better error messages if we remember the label name that the user entered
 	Label target;
 	Expression *computedTarget;
Index: src/examples/control_structures.c
===================================================================
--- src/examples/control_structures.c	(revision 6244dfb9b0062e49cf3bf4ca00c1139881b7972e)
+++ src/examples/control_structures.c	(revision 52ac3b450406acd5a3ee39961262692736abfbf6)
@@ -1,44 +1,43 @@
 int main() {
-  L1: {
-      L2: switch ( 3_333_333 ) {	// underscores in constant
-	  case 1,2,3:			// 4~8, 4...8 not working
-	  L3: for ( ;; ) {
-	      L4: for ( ;; ) {
-		    break L1;		// labelled break
-		    break L2;
-		    break L3;
-		    break L4;
-#if 0
-		    continue L1;	// labelled continue
-		    continue L2;
-		    continue L3;
-		    continue L4;
-#endif
-		} // for
-	    } // for
-	    break;
-	  default:
-	    break L1;
-	} // switch
-	3;
-	int i, j;
-	choose ( 7 ) {
-	  case 1,2,3:
-	    i = 3;
-	    fallthru;
-	  case 4,5,6:
-	    j = 3;
-	  default: ;
-	} // choose
-    } // block
+	L1: {
+		L2: switch ( 3_333_333 ) {  // underscores in constant
+			case 1,2,3:     // 4~8, 4...8 not working
+				L3: for ( ;; ) {
+					L4: for ( ;; ) {
+						break L1;   // labelled break
+						break L2;
+						break L3;
+						break L4;
+
+						// continue L1; // labelled continue - should be an error 
+						// continue L2; // should be an error
+						continue L3;
+						continue L4;
+					} // for
+				} // for
+				break;
+			default:
+				break L1;
+		} // switch
+		3;
+		int i, j;
+		choose ( 7 ) {
+			case 1,2,3:
+				i = 3;
+				fallthru;
+			case 4,5,6:
+				j = 3;
+			default: ;
+		} // choose
+	} // block
 
 #if 0
-    try {
-	int i = 3;
-    } catch( int ) {
-    } catch( double ) {
-    } catch( ... ) {
-    } finally {
-    } // try
+	try {
+		int i = 3;
+	} catch( int ) {
+	} catch( double ) {
+	} catch( ... ) {
+	} finally {
+	} // try
 #endif
 
