Bug fixes
Minor fix for opening file