Deuteronomy 23:5-6 (NIV)
5However, the Lord your God would not listen to Balaam but turned the curse into a blessing for you, because the Lord your God loves you.
6Do not seek a treaty of friendship with them as long as you live.
Psalm 34:18 (NIV)
The LORD is close to the brokenhearted and saves those who are crushed in spirit.
Romans 8:28 (NIV)
And we know that in all things God works for the good of those who love him, who have been called according to his purpose.