Fixed file opening functions, giving control back to the os of the file's working directory.