Portability and typos

Changed some typedefs to #defines.
Corrected some typos.