Fix access violation on x64 platform