Extract specs and types. Fix #9.