Fix bug with determining version