Minors fixes and improvements