Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708198 and https://bugzilla.redhat.com/show_bug.cgi?id=1036374 .