Updated to pass all rubocop and spec tests.