Fixed bug with format detection defaulting to HTML