fixing a bug that manifested only on 32-bit platforms