64 bit fix, not sure if it works on 32 bit yet