Resolves #125 and #129, fixed check on default mime type