Added and tested checking integrity of file.