Fix error code assignment in raw_parser
Fix and add tests for empty_base_optimization.
[FOLD] ebo tidying