Fixes for #5

Updates to counter.rb and accompanying test as requested.