Add apmirror compatibility workarounds