Thanks for your bug report.

The first issue: it looks like the beta is returning the correct result. So this is essentially a backward compatibility issue for scripters who use $lines() on binary files that contain only 0x00 bytes to determine whether they are empty or not. Hmm.

The second issue: overflows are tricky because signed 32bit INTs are used in almost every feature. I might be able to check for this in the core line counting routine though.