Improved version sorting

Fixes Issue #111