For middle of the night feeds you may find attaching with you both lying down works better - it's worth a try.
I found that when my bub was 3 months old things started to hurt - he'd got strong enough that the imperfect attachment that we had was now causing problems.

If your nipples come out a funny shape then the attachment isn't right - in our case I had to get more of the underside of my nipple in his mouth. I went to a lactation day stay, and the nurse there picked it up.