Bug fixes, work in progress.