Update for linux (removed fclose on NULL)
Added test files