Production wastewater treatment