Fix bug with empty strings when getting commit number