Patching minor glitches in my code