Set file to 0L after closing it.
Added a flag to know whether or not a buffer has been modified.
Modified buffer to initialize path to NULL.