resynced recent patches, sorry for the mess