diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index f90628b0d42cc913c5a93844d265ec7dd9388580..b10fa977e749d05fddbc407f5610e47f96299e52 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -9,4 +9,10 @@ class ApplicationController < ActionController::Base
       Rack::MiniProfiler.authorize_request
     end
   end
+
+  protected
+
+  def current_account
+    current_user.try(:account)
+  end
 end
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 34684a06f3222d2e36ec844b0c8f9de654e971a1..dc030736be5f5c5d04c90daafcdc9f62ce19af93 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -54,6 +54,10 @@ class FanOutOnWriteService < BaseService
       def current_user
         @account.user
       end
+
+      def current_account
+        @account
+      end
     end
 
     Rabl::Renderer.new('api/statuses/show', status,  view_path: 'app/views', format: :json, scope: rabl_scope.new(receiver)).render
diff --git a/app/views/api/accounts/show.rabl b/app/views/api/accounts/show.rabl
index df70943dd6229652739f049401aa438ec595e9fe..05c92c99dd97cd93aa02ca12840dbb2237ffd9d9 100644
--- a/app/views/api/accounts/show.rabl
+++ b/app/views/api/accounts/show.rabl
@@ -7,4 +7,4 @@ node(:avatar)          { |account| asset_url(account.avatar.url(:large, false))
 node(:followers_count) { |account| account.followers.count }
 node(:following_count) { |account| account.following.count }
 node(:statuses_count)  { |account| account.statuses.count  }
-node(:following)       { |account| current_user.account.following?(account) }
+node(:following)       { |account| current_account.following?(account) }
diff --git a/app/views/api/statuses/show.rabl b/app/views/api/statuses/show.rabl
index b4a73f9a6e32f55a0b8a6f117a8658ea0c781e0d..0f44188704ae3cb48b9b67b870b6fc74d70d6c72 100644
--- a/app/views/api/statuses/show.rabl
+++ b/app/views/api/statuses/show.rabl
@@ -6,8 +6,8 @@ node(:content)          { |status| content_for_status(status) }
 node(:url)              { |status| url_for_target(status) }
 node(:reblogs_count)    { |status| status.reblogs_count }
 node(:favourites_count) { |status| status.favourites_count }
-node(:favourited)       { |status| current_user.account.favourited?(status) }
-node(:reblogged)        { |status| current_user.account.reblogged?(status) }
+node(:favourited)       { |status| current_account.favourited?(status) }
+node(:reblogged)        { |status| current_account.reblogged?(status) }
 
 child :reblog => :reblog do
   extends('api/statuses/show')
diff --git a/config/database.yml b/config/database.yml
index da88c65a0050688fe33de4a8637468079b96a697..e0df97ad2c9d07b5dec7f479499318c5c6ee10cb 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -1,6 +1,6 @@
 default: &default
   adapter: postgresql
-  pool: 15
+  pool: 17
   timeout: 5000
   encoding: unicode
 
diff --git a/config/initializers/rack-mini-profiler.rb b/config/initializers/rack-mini-profiler.rb
index 7fd50a9af770099549d7769c0bb9cd67e1e66e48..01e8aaa15a71ae9225fe792a21168aecc3eaad7d 100644
--- a/config/initializers/rack-mini-profiler.rb
+++ b/config/initializers/rack-mini-profiler.rb
@@ -1,2 +1,4 @@
-Rails.application.middleware.swap(Rack::Deflater, Rack::MiniProfiler)
-Rails.application.middleware.swap(Rack::MiniProfiler, Rack::Deflater)
+unless Rails.env == 'test'
+  Rails.application.middleware.swap(Rack::Deflater, Rack::MiniProfiler)
+  Rails.application.middleware.swap(Rack::MiniProfiler, Rack::Deflater)
+end