PatchLibrary: minor improvements