Fix compatibility with woocommerce 2.1.2