Small fixes and improvements