Fix segfault with GTK3
Improvements for GTK3