Rebase from Fletcher Big PR#427.
Solving SPEC issues.