Bugfixes to ProductValue code (tests still fail)