Fix defects detected by rubocop.