Fix for 32bit segmentation fault