Bug fixes and improvements in clarity