Added some missing range checks on count in IOExtensions.