Fix issues with the patch for Gtk improvements.

* Free where it is necessary
* Do not stop before setting uri