Made a typo in the code to fix OUTER JOIN.  This made inner joins NATURAL joins, which is incorrect