diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 2e61dd5..40ad7ec 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -650,8 +650,14 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
 		/* check literals */
 		for(j = dbs_sync; j && !found; j = j->next) {
 			if((sync = _alpm_db_get_pkgfromcache(j->data, missdep->name))) {
-				found = alpm_depcmp(sync, missdep) && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove);
 				/* we won't add to-be-replaced packages */
+				found = alpm_depcmp(sync, missdep) && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove);
+				/* we won't add IgnorePkg, unless user wants this */
+				if(found && alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(sync))) {
+					pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
+					QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &found);
+					_alpm_pkg_free(dummypkg);
+				}
 			}
 		}
 		/*TODO this autoresolves the first 'satisfier' package... we should fix this
@@ -660,7 +666,12 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
 		for(j = dbs_sync; j && !found; j = j->next) {
 			for(k = _alpm_db_get_pkgcache(j->data); k && !found; k = k->next) {
 				sync = k->data;
-				found = alpm_depcmp(sync, missdep) && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove);
+				found = sync && alpm_depcmp(sync, missdep) && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove);
+				if(found && alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(sync))) {
+					pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
+					QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &found);
+					_alpm_pkg_free(dummypkg);
+				}
 			}
 		}
 
@@ -679,38 +690,14 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
 			}
 			pm_errno = PM_ERR_UNSATISFIED_DEPS;
 			goto error;
-		}
-		/* check pmo_ignorepkg and pmo_s_ignore to make sure we haven't pulled in
-		 * something we're not supposed to.
-		 */
-		int usedep = 1;
-		if(alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(sync))) {
-			pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
-			QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &usedep);
-			_alpm_pkg_free(dummypkg);
-		}
-		if(usedep) {
-			_alpm_log(PM_LOG_DEBUG, "pulling dependency %s (needed by %s)",
+		} else {
+			 _alpm_log(PM_LOG_DEBUG, "pulling dependency %s (needed by %s)",       
 					alpm_pkg_get_name(sync), alpm_pkg_get_name(syncpkg));
 			*list = alpm_list_add(*list, sync);
 			if(_alpm_resolvedeps(local, dbs_sync, sync, list, remove, trans, data)) {
 				goto error;
 			}
-		} else {
-			_alpm_log(PM_LOG_ERROR, _("cannot resolve dependencies for \"%s\""), miss->target);
-			if(data) {
-				if((miss = malloc(sizeof(pmdepmissing_t))) == NULL) {
-					_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmdepmissing_t));
-					FREELIST(*data);
-					pm_errno = PM_ERR_MEMORY;
-					goto error;
-				}
-				*miss = *(pmdepmissing_t *)i->data;
-				*data = alpm_list_add(*data, miss);
-			}
-			pm_errno = PM_ERR_UNSATISFIED_DEPS;
-			goto error;
-		}
+		}	
 	}
 	
 	_alpm_log(PM_LOG_DEBUG, "finished resolving dependencies");
