various corrections and improvements