Fixed issue with file handling.