bug fix, and added AMD tests