Fixed typos. Added code to work around IDE pre-processor bug.