More uniform way to generate run_numbers.
Performing update on selection changed only when 'logged in'
to avoid strange error messages.
Fixed typo