Fixed rubocop issues, fixed failing tests