Logcially detect content type or fallback to text/html, fix a Date bug