Fix checkversion logic, add some logging