+1, I seem to have misunderstood the intended purpose of g_return_if_fail.

(Speaking of which - are statements inside of g_return_if_fail stripped out if NDEBUG is defined like assert? If so, there's a possibility I might be mutating state inside of them, which is bad, for obvious reasons).