Fix for the new DISABLE_MAIN flag