Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision 13de4478412abd33f139ec84186ad2c7b0e777a3)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
@@ -906,5 +906,5 @@
 				}
 				CandidateRef & choice = winners.front();
-				choice->cost.incVar();
+				choice->cost.incSafe();
 				candidates.emplace_back( std::move(choice) );
 			}
@@ -1376,15 +1376,17 @@
 			ast::Expr * newExpr = data.combine( nameExpr->location, cost );
 
-			bool bentConversion = false;
-			if ( auto inst = newExpr->result.as<ast::EnumInstType>() ) {
-				if ( inst->base && inst->base->base ) {
-					bentConversion = true;
-				}
-			}
-
+			// bool bentConversion = false;
+			// if ( auto inst = newExpr->result.as<ast::EnumInstType>() ) {
+			// 	if ( inst->base && inst->base->base ) {
+			// 		bentConversion = true;
+			// 	}
+			// }
+
+			// CandidateRef newCand = std::make_shared<Candidate>(
+			// 	newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, bentConversion? Cost::safe: Cost::zero,
+			// 	cost );
 			CandidateRef newCand = std::make_shared<Candidate>(
-				newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, bentConversion? Cost::safe: Cost::zero,
+				newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, Cost::zero,
 				cost );
-
 			if (newCand->expr->env) {
 				newCand->env.add(*newCand->expr->env);
@@ -1829,10 +1831,14 @@
 					Cost cost = Cost::zero;
 					ast::Expr * newExpr = data.combine( expr->location, cost );
+					// CandidateRef newCand =
+					// 	std::make_shared<Candidate>(
+					// 		newExpr, copy( tenv ), ast::OpenVarSet{},
+					// 		ast::AssertionSet{}, Cost::safe, cost
+					// 	);
 					CandidateRef newCand =
 						std::make_shared<Candidate>(
 							newExpr, copy( tenv ), ast::OpenVarSet{},
-							ast::AssertionSet{}, Cost::safe, cost
+							ast::AssertionSet{}, Cost::zero, cost
 						);
-
 					if (newCand->expr->env) {
 						newCand->env.add(*newCand->expr->env);
Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision 13de4478412abd33f139ec84186ad2c7b0e777a3)
+++ src/ResolvExpr/CastCost.cc	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
@@ -53,5 +53,43 @@
 			} else {
 				cost = conversionCost( basicType, dst, srcIsLvalue, symtab, env );
+				if ( Cost::unsafe < cost ) {
+					if (auto enumInst =  dynamic_cast<const ast::EnumInstType *>(dst)) {
+						assert(enumInst->base->base);
+						cost = Cost::unsafe;
+					}
+				}
 			}
+		}
+
+		void postvisit( const ast::ZeroType * zero ) {
+			// auto ptr = dynamic_cast< const ast::PointerType * >( dst );
+			// if ( ptr && basicType->isInteger() ) {
+			// 	// needed for, e.g. unsigned long => void *
+			// 	cost = Cost::unsafe;
+			// } else {
+			cost = conversionCost( zero, dst, srcIsLvalue, symtab, env );
+			if ( Cost::unsafe < cost ) {
+				if (auto enumInst =  dynamic_cast<const ast::EnumInstType *>(dst)) {
+					assert(enumInst->base->base);
+					cost = Cost::unsafe;
+				}
+			}
+			// }
+		}
+
+		void postvisit( const ast::OneType * one ) {
+			// auto ptr = dynamic_cast< const ast::PointerType * >( dst );
+			// if ( ptr && basicType->isInteger() ) {
+			// 	// needed for, e.g. unsigned long => void *
+			// 	cost = Cost::unsafe;
+			// } else {
+			cost = conversionCost( one, dst, srcIsLvalue, symtab, env );
+			if ( Cost::unsafe < cost ) {
+				if (auto enumInst =  dynamic_cast<const ast::EnumInstType *>(dst)) {
+					assert(enumInst->base->base);
+					cost = Cost::unsafe;
+				}
+			}
+			// }
 		}
 
@@ -80,4 +118,10 @@
 					cost = Cost::unsafe;
 				}
+			}
+		}
+
+		void postvist( const ast::EnumInstType * ) {
+			if ( auto basic = dynamic_cast< const ast::BasicType * >(dst) ) {
+				if ( basic->isInteger() ) cost = Cost::unsafe;
 			}
 		}
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision 13de4478412abd33f139ec84186ad2c7b0e777a3)
+++ src/ResolvExpr/ConversionCost.cc	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
@@ -284,6 +284,5 @@
 	} else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
 		if ( dstAsEnumInst->base && !dstAsEnumInst->base->base ) {
-			cost = Cost::zero;
-			cost.incUnsafe();
+			cost = Cost::unsafe;
 		}
 	}
@@ -482,6 +481,5 @@
 	} else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
 		if ( dstAsEnumInst->base && !dstAsEnumInst->base->base ) {
-			cost = Cost::zero;
-			cost.incUnsafe();
+			cost = Cost::unsafe;
 		}
 	}
@@ -504,6 +502,5 @@
 	} else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
 		if ( dstAsEnumInst->base && !dstAsEnumInst->base->base ) {
-			cost = Cost::zero;
-			cost.incUnsafe();
+			cost = Cost::unsafe;
 		}
 	}
