Bug fixes and minor changes.