conversion to AMD and minor bugfixes