Fix infinite loop while writing a chunk changing the way in which free space is searched in the region file.
Add exception when opening files too small to be a region file.
Merge pull request #66 from Fenixin/fix-update

Fix infinite loop when writing a chunk. Add new exception.