Fix build on 32-bit linux, fix automake error, some typos

Now it builds for me on both 32-bit and 64-bit linuxes. Fixed a few typos when I saw them, hope you don't mind.