Fix build without GTK+
Fix build under OSX
Fix build error