fixing handle pointers on 64bit platforms