Component rearangement to address bugs #8 and #6.

See individual commits for details.