Fix bugs in heroku