Updated for compatibility with spree 2-4-stable