Fix add to cart bug.

Fixes #514.