Replaced deprecated GObject methods with GLib methods