Fixes capstruct construction.
The build function now works, but match is a little wonky until semantics have been worked out completely.