Minor fixes and improvements