Fix tests and rubocop