Work in progress.

Some fixes.