Patches to simtoi for OSX