Handle multiple Content-Type fields more robustly; other changes