better parse of Content-Type header
minor fixes