Clean up rubocop errors

Also fix a logic error I missed