Improve selection of require packages. bnc#895070. bnc#896178. bnc#896185.