Purana Jyotisha Sangraha · by Vyasa
Chapter 14 · Ujjain: Shani and the Planet Tirthas
स्कन्दपुराणम् : अवन्त्यां शनिः ग्रहतीर्थानि च
ज्ञातमेव यथाकालं गच्छ राजन्कुशस्थलीम् ।महाकालसमीपे तु लिंगं दुःस्वप्ननाशनम् ॥ ५१ ॥
From the Skanda Purana, print Avantya Khanda, Chaturashiti-linga-mahatmya ch 80, verse 51.
"It is known. In due time, go, O king, to Kushasthali. Near Mahakala there is a linga (the stone symbol of Shiva) that destroys bad dreams."
Simple meaning: Vasishtha tells the king to go to the linga near Mahakala that destroys bad dreams.
राजसंपत्करं दिव्यं पुत्रपौत्रविवर्द्धनम् ।
Seeing this linga is said to bring wealth, sons and grandsons, and to free one from sin.
दुःस्वप्नजं भयं घोरं विनंक्ष्यति न संशयः ।
Vasishtha says the fear from bad dreams will go and the planets will be favourable.
इत्युक्तो गुरुणा भूयो वशिष्ठेन महात्मना ।
The king went to Mahakala forest and saw the linga that destroys bad dreams.