Add rubocop and fix a few errors