Minor modifications merged from my thesis