Fixes to stats controller and rubocop