diff --git a/lib/nicorepo.rb b/lib/nicorepo.rb
index <HASH>..<HASH> 100644
--- a/lib/nicorepo.rb
+++ b/lib/nicorepo.rb
@@ -34,6 +34,8 @@ class Nicorepo
     page = @agent.get(URL::REPO_ALL)
     log_nodes = page.search('div.timeline/div.log')
 
+    log_nodes = log_nodes[0, max_logs] if log_nodes.size > max_logs
+
     logs = log_nodes.map do |node|
       log = Log.new
       log.title = parse_title node
diff --git a/spec/nicorepo_spec.rb b/spec/nicorepo_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/nicorepo_spec.rb
+++ b/spec/nicorepo_spec.rb
@@ -27,10 +27,14 @@ describe Nicorepo do
   describe "#all" do
     context "without arguments" do
       it "should return 20 logs" do
-        # @nicorepo.all.size.should eq 20
         @nicorepo.all.should have(20).logs
       end
     end
+    context "with 5" do
+      it "should return 5 logs" do
+        @nicorepo.all(5).should have(5).logs
+      end
+    end
   end
 
   describe Nicorepo::Log do
modify #all to work with specific number of logs (less than <I>)