[PATCH v2 00/13] Various small cleanups and improvements