Our puppy spent his first five months locked in a cage at a puppymill before being rescued. He was with a foster family for three weeks who taught him that people can be loving and affectionate. He was afraid of doorways and you couldn't bend down to pet him without causing him great fear. It took only a few hours of kindness, affection and tenderness and he was playing with toys. He was housebroken in just two weeks (after spending his life in a cage doing his business whenever he wanted) and he loves to learn new tricks. Don't worry about your puppy being set in his ways. Show him lots of love and attention, praise and petting. He will be eager to please you.
One of my schnauzers was also kept in a small cage for the first three months of his life. It took about a month or so for him to come out of his shell. He would shake and stand in one spot for the first month. He is a great dog now. He loves to play and be petted. I wouldn't trade him for anything. I also have another schnauzer so it helps to have someone for them to play with when I'm not at home.