Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision e5c38112cf0116f0fcdd3e08dd4133429b2ecfbe)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision 4702a2cac45f6559d5d3404ee4ce0c09192620f3)
@@ -1101,6 +1101,9 @@
 				// unification run for side-effects
 				unify( toType, cand->expr->result, cand->env, need, have, open, symtab );
-				Cost thisCost = castCost( cand->expr->result, toType, cand->expr->get_lvalue(),
-						symtab, cand->env );
+				Cost thisCost = 
+					(castExpr->isGenerated == ast::GeneratedFlag::GeneratedCast)
+ 	                    ? conversionCost( cand->expr->result, toType, cand->expr->get_lvalue(), symtab, cand->env )
+ 	                    : castCost( cand->expr->result, toType, cand->expr->get_lvalue(), symtab, cand->env );
+
 				PRINT(
 					std::cerr << "working on cast with result: " << toType << std::endl;
@@ -1591,8 +1594,19 @@
 
 					// unification run for side-effects
-					unify( toType, cand->expr->result, env, need, have, open, symtab );
+					bool canUnify = unify( toType, cand->expr->result, env, need, have, open, symtab );
+                    (void) canUnify;
 					Cost thisCost = computeConversionCost( cand->expr->result, toType, cand->expr->get_lvalue(),
+						symtab, env );
+					PRINT(
+						Cost legacyCost = castCost( cand->expr->result, toType, cand->expr->get_lvalue(),
 							symtab, env );
-
+						std::cerr << "Considering initialization:";
+						std::cerr << std::endl << "  FROM: " << cand->expr->result << std::endl;
+						std::cerr << std::endl << "  TO: "   << toType             << std::endl;
+						std::cerr << std::endl << "  Unification " << (canUnify ? "succeeded" : "failed");
+						std::cerr << std::endl << "  Legacy cost " << legacyCost;
+						std::cerr << std::endl << "  New cost " << thisCost;
+						std::cerr << std::endl;
+					)
 					if ( thisCost != Cost::infinity ) {
 						// count one safe conversion for each value that is thrown away
Index: src/ResolvExpr/Resolver.h
===================================================================
--- src/ResolvExpr/Resolver.h	(revision e5c38112cf0116f0fcdd3e08dd4133429b2ecfbe)
+++ src/ResolvExpr/Resolver.h	(revision 4702a2cac45f6559d5d3404ee4ce0c09192620f3)
@@ -35,5 +35,5 @@
 	class StmtExpr;
 	class SymbolTable;
-	class TranslationUnit;
+	struct TranslationUnit;
 	class Type;
 	class TypeEnvironment;
@@ -63,5 +63,5 @@
 	ast::ptr< ast::Expr > resolveInVoidContext(
 		const ast::Expr * expr, const ast::SymbolTable & symtab, ast::TypeEnvironment & env );
-	/// Resolve `untyped` to the single expression whose candidate is the best match for the 
+	/// Resolve `untyped` to the single expression whose candidate is the best match for the
 	/// given type.
 	ast::ptr< ast::Expr > findSingleExpression(
