It's a known bug with the parser. You just need to have anything that uses dpl, such as random-article templates, to appear above any references.
A bug fixed with DPL 2.0. We should upgrade.
Yah, it is time to look towards upgrading. The main thing I need to do is get rwbeta running again to test this shit instead of dumping it on live and crossing my fingers.
DPL 2.0 isn't publicly available, and it's been largely abandoned.