Fixed rubocop's IfUnlessModifier warnings.