Fix heroku branch middleware