Fixing crash that only manifests itself on 64bit