fixes to AMD model and window scoping