Fix bug in with_custom_data_pool
fix some discard tests