Some changes to make it heroku-friendly