Fix incorrect usage of g_return_if_fail() in a function which must return a boolean value.