Minor revisions and bug fixes.