Rubocop and test fixes