Hardening/assoc unit test hotfix

Fixes a bug that caused a few unit and harness tests to faik. The bug I had introduced myself previously, no record of it.

Also a new unit test for associations.
Did you fix it from where you copied it too ;-)

NTC