Fixed inconsistencies between 32 and 64 bits