Fixed chunk number calculation.

See JIRA ticket. Tested in Windows and MAC. Fixes a test in Drive that was consistently failing in Windows.