It seems that you can't get through an entire story about Abraham or Jacob without one of the later Levitical laws being broken. They were shrewd business men, bartering with locals, appeasing those angry with them with gifts and promises.
When Abram meets with God for the first time, he was a man out of the center of civilization at the time, the city of Ur in Mesopotamia. He trusted God's promises that if he went to where God told him, he would be made into a great nation, be blessed and a slew of other blessings. Abram does this. He shows two weaknesses during his life. The first takes place almost immediately after he leaves Ur ( as told in the story... there were over a thousand of miles walked between the events.) Abram doesn't trust that God will protect him and his beautiful wife from the Pharaoh, so he instructs Sarai to pretend to be his sister. The pharaoh is cursed, discovers their true relationship and sends Abram and his family on their way. This same deception is repeated after the change of his name from Abram to Abraham. The other area of weakness is Abraham and Sarah's trust that God will provide them with an heir. They take things into their own hands and as is typical when we do these things, make a mess of the situation. Abraham's life doesn't smooth out until after he encounters God on the mountain in Moriah. It is at this encounter where God affirms his conditional covenants with Abraham and makes them everlasting promises.
The change in Jacob's life are more visible than that of Abraham's. The first stories of Jacob, until he is given the name Israel, are of a man who does anything to get what he wants, deceiving his father to get his blessing, bribing his brother for his birthright, even wrestling with God with hopes that he might win. He was given an appropriate name (he deceives). After the encounter with God, Jacob was a changed man. Every story of Jacob's life before this encounter with God (except for the story of his dream at Bethel) involves deceit on one side or the other. Not one story of deceit is recorded after he meets God at Peniel. As a symbol of this change, God changed his name to Israel ( he struggles with God.)
As Hebrews states, it isn't that they were great men of God, being perfect in every way. They had faith in God. That faith was credited to them as righteousness and since they were made righteous, they are able to be in God's presence.