Fix for empty documents. Also improved RDF format guessing by taking the file extension and content typo into acount (like in the previous version).