--- orig.aat_legacy.module	2009-08-21 06:55:29.000000000 -0400
+++ aat_legacy.module	2009-08-21 06:54:54.000000000 -0400
@@ -21,7 +21,7 @@ function amazon_node_info() {
 
 function aat_legacy_load($node) {
   $asins = array();
-  $sql = "SELECT * FROM {amazon_item_node} ain WHERE ain.nid = %d ORDER BY delta ASC WHERE ain.module = 'aat_legacy'";
+  $sql = "SELECT * FROM {amazon_item_node} ain WHERE ain.nid = %d AND ain.module = 'aat_legacy' ORDER BY delta ASC";
   $results = db_query($sql, $node->nid);
   while ($asin = db_fetch_array($results)) {
     $asins[$asin['asin']] = $asin;
@@ -34,7 +34,7 @@ function aat_legacy_view(&$node, $teaser
   foreach ($asins as $asin) {
     $node->content['aat_legacy_items'][] = array(
       '#type' => 'markup',
-      '#value' => theme('amazon_item', theme('amazon_item', $product))
+      '#value' => theme('amazon_item', $asin)
     );
   }
 }
