Fix to work on 32 bit machines
Fix sector offset calculation to not overflow