Modify for libglib older than 2.40