Change some asserts into g_return_if_fail()
Because crashing asserts are bad, and maybe this helps fix the captures_build_path issue with debian's reproducible builds (those asserts probably include FILE)