Judith
What you describe is 2 seperate issues and not necessarily connected to each other. It's all part of normal development.
He is becoming aware of the world around him hense the origon of the dreams/nightmares. Leave a night light on, and when he wakes crying etc give a cuddle and reassurence.
Re- the clingy phase - its nothing you've done. Some children are more clingy than others. Management requires patience and sensitivity. Start reassurences in small steps eg "Mommy's going into the kitchen /bathroom and will be right back" Always tell him where you are going and when you will be back, and always truthful.
Example - Give a time- point to the clock- "when the big/hand is on ?? I will be right back" This also teaches him to read time/clock.
Habits are formed at this age and if he learns he can control your movements you may have trouble later on.
Toddlers whole existence is centred around parents / bonded carers, and trying to make sense of the world around him with realities of daily living is difficult at this age. Gaining his TRUST is the key to his feeling secure.