Which one of the sentences is correct?
A.
The man had only one arm caused by a railway accident.
B.
Having studied all night, I aced the test.
C.
Watching the cars going by, the traffic was very heavy.
D.
After planting the shrubs, the rain began to fall.