Fix bug when trying to save documents that are not source code