Fix spree issues #3531 and #2210 (patch provided by leiyangyou)