(Hopefully) fixed error on amd, Various fixes