Make fix-products-paths more reusable.

Also, simplify syntax (no need for a loop).
Also, actually propagate error from all commands.