Many edits/bug fixes and improvements.