Miscellaneous work.
Towards a real implementation.