Fix logic and rubocop offences.

Checks for ruby version >= 1.9.2, fixed rubocop offence due to
if flow.