Clean up tags before storing in DB