Fix version extraction code (RHBZ#1140216)

https://bugzilla.redhat.com/show_bug.cgi?id=1140216

Signed-off-by: Tomas Hozza <thozza@redhat.com>