Added required main_context and turned assert() off by default