Applied patch from Giulio Orsero to fix some preprocessor bugs.