Thanks for the update that this could help you ...

You may also wish to look at the Known Bug Fixes for v1.3.8 at:
http://www.zen-cart.com/forum/showthread.php?p=697924

especially those related to master_categories_id for things like SaleMaker, Coupons etc. as these fixes can help too in many situations particularly on sites with Linked Products ...