Fixed many rubocop and spec errors.