Cleanup of spec processing.
Refinements and additions to spec parsing.