fix a bunch of cast and type warnings and don't call the apic "nvram", that