Made a few more bug fixes to make it heroku runnable.