Improved version matching in lib
and core
commands.
#2110
Merged
lib
and core
commands.
#2110