Fixes

In addition to preliminary work on variable declaration rules, it contains a ton of fixes to places where the PreProcessor crashes.