Incorporated glib library APIs for cleaner, safer code.