fix of #2851 and #3064

fixes
https://github.com/spree/spree/issues/2851
https://github.com/spree/spree/issues/3064