Random fixes and improvements