Fixed implicit conversion loses integer precision warnings

Fixed the implicit conversion loses integer precision warnings by using 64-bit file functions and correcting the delegate declaration.