Fixed bug caused by no content-type set
Fixed bug caused by no mimetype set
Fixed broken test