Cleanup old patch code