Added some major fixes to the fs_open and format functions