Made a number of fixes in response to comments.