CMS-4145 Versions not ordered by timestamp desc for "active versions"

Adding ordering of map. Something strange happens when equal versions.