Bug fix: Populate offsets[] correctly.