Malformed url fix and Heroku fix