Try and convert the version numbers to a conforming format with the version module. Compare the parsed and newly created (->declare() 'ed) version objects.
This now correctly handles eg. 1.13 <=> 1.15.1, so that the latter will be "greater" than the former.