Don't assume the size of 'short' and 'long' types to be 16- and 32-bits respectively. This was causing crashing issues on my 64-bit OS X installation due to buffer overruns. This would also cause games that ran on systems with different sizes for those types to be unable to communicate properly.