Put the g_return_val_if_fail() in the right place.