A bunch of little fixes and improvements.