Bug fixes

Minor bug fixes; no new features.