added support of files more than 2GB
fixed warnings from static analysis tool